package com.oda.resultats;

import com.activity.colza.R;
import com.activity.colza.R.layout;
import com.activity.colza.R.menu;
import com.oda.resultats.util.MExpendableListAdapter;
import com.oda.resultats.util.TitleGroup;

import android.os.Bundle;
import android.app.Activity;
import android.util.SparseArray;
import android.view.Menu;
import android.widget.ExpandableListView;

public class ODA_AllRes_Activity extends Activity {
	SparseArray<TitleGroup> groups = new SparseArray<TitleGroup>();
	String []donnees={"Biomasse","Taux d'erreur","LAI","Exportation Azote"};
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_all_results);
		createData();
		ExpandableListView exlist=(ExpandableListView) findViewById(R.id.exlistView);
		MExpendableListAdapter adapter=new MExpendableListAdapter(groups, this);
		exlist.setAdapter(adapter);
		
	}
	
	public void createData() {
	    for (int j = 0; j < 15; j++) {
	      TitleGroup group = new TitleGroup("Résultat du: " + j);
	      for (int i = 0; i < donnees.length; i++) {
	        group.children.add(donnees[i]);
	      }
	      groups.append(j, group);
	    }
	  }

	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		// Inflate the menu; this adds items to the action bar if it is present.
		getMenuInflater().inflate(R.menu.all_results, menu);
		return true;
	}

}
